package com.vitabuybuy.tv.ui.mine.talent.usercenter

import android.os.Bundle
import androidx.core.os.bundleOf
import com.library.common.base.BaseActivity
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.ActivityIncomeRecordDetailBinding
import com.vitabuybuy.tv.ui.mine.talent.usercenter.viewmodel.IncomeRecordViewModel

class IncomeRecordDetailActivity :
    BaseActivity<IncomeRecordViewModel, ActivityIncomeRecordDetailBinding>() {
    override val isUseBaseTitleBar: Boolean
        get() = true
    override val layoutId: Int
        get() = R.layout.activity_income_record_detail

    private var id: Int? = 0
    override fun onGetBundle(bundle: Bundle?) {
        id = bundle?.getInt("id")
    }

    override fun initView(savedInstanceState: Bundle?) {
        setTitle(getString(R.string.income_record_detail))
        mBinding.mViewModel = viewModel
    }

    override fun observeData() {
        viewModel.getRecordDetail(id)
    }

    companion object {
        fun openActivity(mContext: BaseActivity<*, *>, id: Int?) {
            mContext.startActivity(bundleOf(Pair("id", id)), IncomeRecordDetailActivity::class.java)
        }
    }
}
